<?php

namespace App\Http\Model;

use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    //此模型关联的数据表
    protected $table = 'sad_order';

    //    表的主键
    public $primaryKey = 'id';
    //不更新created_at  updated_at字段
    public $timestamps = false;
    public $guarded = [];


    // 对前台用户列表一对多
    // 此表为副表1
    public function home_user1()
    {
    	return $this->belongsTo('App\Http\Model\Home_user','uid','id');
    }

    public function home_user2()
    {
    	return $this->belongsTo('App\Http\Model\Home_user','rid','id');
    }


    // 对商品板块列表一对多
    // 副表2
    public function goods()
    {
    	return $this->belongsTo('App\Http\Model\Goods','gid','id');
    }

}
